import request from '@/utils/request'

export default {
    //生成订单
  createOrders(courseId) {
    return request({
      url: '/eduorder/order/createOrder/'+courseId,
      method: 'post'
    })
  },
  //根据订单id查询订单信息
  getOrdersInfo(id) {
    return request({
      url: '/eduorder/order/getOrderInfo/'+id,
      method: 'post'
    })
  },
  //生成二维码的方法
  createNatvie(orderNo) {
    return request({
      url: '/eduorder/paylog/createNative/'+orderNo,
      method: 'get'
    })
  },
  password(data, mobile) {
    return request({
      url: '/order/password/' + mobile,
      method: 'post',
      data: data
    })
  },
  save(data) {
    return request({
      url: '/order/save',
      method: 'post',
      data
    })
  },
  //查询订单状态的方法
  //生成二维码的方法
  queryPayStatus(orderNo) {
    return request({
      url: '/eduorder/paylog/queryPayStatus/'+orderNo,
      method: 'get'
    })
  },
  getOrder(data, page,mobile) {
    return request({
      url: '/order/page?pageNum=' + page.pageNum + "&pageSize=" + page.pageSize+"&mobile="+mobile,
      method: 'post',
      data
    })
  },
  checkOldPassword(pwd, mobile) {
    return request({
      url: '/order/checkOldPwd?password=' + pwd + '&mobile=' + mobile,
      method: 'get',
    })
  }
}
